<?php
$url = "http://lf.snssdk.com/api/news/feed/v44/?version_code=5.8.2&app_name=news_article&vid=EEA0436D-2748-49B8-B49F-786D21EC6B58&device_id=27439213407&channel=App%20Store&resolution=750*1334&aid=13&ab_version=72359,83096,77081,79287,85688,85046,83772,85442,85626,31211,85409,82678,85230,85795,85653,85016,84555,82763&ab_feature=z2&ab_group=z2&openudid=6a1c962b914ea3793c9f5290cbd37ea3af38a086&live_sdk_version=1.3.0&idfv=EEA0436D-2748-49B8-B49F-786D21EC6B58&ac=WIFI&os_version=10.0.2&ssmix=a&device_platform=iphone&iid=5815459828&ab_client=a1,f2,f7,e1&device_type=iPhone%206&idfa=0CCA7EC1-6CF0-492B-80D5-7F91F4B75C4D&LBS_status=authroize&category=news_local&city=%E8%A5%BF%E5%AE%89&concern_id=6216118362792004098&count=20&cp=508f0e1cBeC36q1&detail=1&image=1&language=zh-Hans-CN&last_refresh_sub_entrance_interval=1476508726&loc_mode=1&min_behot_time=1476508524&refer=1&strict=0&tt_from=tab";
$queryServer = curl_init();
curl_setopt($queryServer, CURLOPT_URL, $url);
curl_setopt($queryServer, CURLOPT_HEADER, 0);
curl_setopt($queryServer, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($queryServer, CURLOPT_RETURNTRANSFER, true);
curl_setopt($queryServer, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($queryServer, CURLOPT_TIMEOUT, 30);
$html = curl_exec($queryServer);
$html = iconv('UTF-8','GBK//IGNORE',$html); //如果你需要是的数据是utf-8编码的,这一行可以注销，如果需要gbk编码的,请保留.如果出现乱码，就是一行的问题，你自己调着试吧
//echo $holder;exit; 此处可以输出来测试.
$html = str_replace(array("\n","\r","\t"),"",$html);
$preg = '/<table\s+width=\"800\"[^>]+>(.*?)<\/table>/';
preg_match_all($preg,$html,$out);
//匹配每行
preg_match_all('/<tr[^>]+>(.*?)<\/tr>/',$out[1][0],$tr);
//匹配每个td
$result = array();
$match = '/<td.+>([^<]+)<\/td>/U';
foreach( $tr[0] as $key => $value ){
preg_match_all($match,$value,$arr);
$result[] = $arr[1];
}
//输出测试,$result就是你要的数据，至于你要怎么输出显示格式，那就随心调就好了。
foreach( $result as $key => $value ){
echo implode("\t",$value);
echo "";
}
exit;


 ?>
